package com.hollycrm.hollysqm.handle.service;

import java.util.ArrayList;
import java.util.List;

import com.hollycrm.hollysqm.bean.PlanMethodBean;
import com.hollycrm.hollysqm.entities.TblSnsSessionQuery;
import com.hollycrm.hollysqm.entities.TblVocCustcontinfo;

/**
 * 抽取策略和分配质检员业务类的父类，为它们提供公共方法
 * @author wangyf
 *
 * 2017年4月5日
 */
public class MethodService {
	
	/**
	 * v8接触记录包装成公共实体
	 * @param infoList
	 * @return
	 */
	public List<PlanMethodBean> parseV8Record(List<TblVocCustcontinfo> infoList) {
		PlanMethodBean bean = null;
		List<PlanMethodBean> list = new ArrayList<PlanMethodBean>();
		for(TblVocCustcontinfo info :infoList) {
			bean = new PlanMethodBean();
			bean.setDay(info.getDay());
			bean.setId(info.getCustcontinfoId());
			bean.setMonth(info.getMonth());
			bean.setTime(info.getAcceptTime());
			bean.setUserCode(info.getUserCode());
			bean.setYear(info.getYear());
			list.add(bean);
		}
		return list;
	}
	
	/**
	 * I8接触记录包装成公共实体
	 * @param infoList
	 * @return
	 */
	public List<PlanMethodBean> parseI8Record(List<TblSnsSessionQuery> infoList) {
		PlanMethodBean bean = null;
		List<PlanMethodBean> list = new ArrayList<PlanMethodBean>();
		for(TblSnsSessionQuery info :infoList) {
			bean = new PlanMethodBean();
			bean.setDay(info.getDay());
			bean.setId(info.getSessionId());
			bean.setMonth(info.getMonth());
			bean.setTime(info.getContactTime());
			bean.setUserCode(info.getAgentCode());
			bean.setYear(info.getYear());
			list.add(bean);
		}
		return list;
	}

}
